import { post } from '../ck/plugin/axios'

class RoleManage {
  //获取角色列表接口
  static async getRoleList ({
    Page,
    Limit
  }) {
    return post('api/Manage/Role/PageSearch', {
      Page,
      Limit
    })
  }

  //新增角色接口
  static async addRoles ({
    RoleName,
    Describe
  }) {
    return post('api/Manage/Role/Add', {
      RoleName,
      Describe
    })
  }

  //改变启停状态
  static async statusChange (ID, Status) {
    return post('api/Manage/Role/UpdateStatus', {
      ID,
      Status
    })
  }

  //点击编辑按钮，查看本条数据的详情
  static async showRoleInfo (ID) {
    return post('api/Manage/Role/SearchModelDetails', {
      ID
    })
  }

  //点击编辑表单中的确定按钮，实现真正的编辑提交
  static async editRoleInfo ({
    ID,
    RoleName,
    Describe
  }) {
    return post('api/Manage/Role/Update', {
      ID,
      RoleName,
      Describe
    })
  }

  //点击分配权限获取权限信息
  static async setRights () {
    return post('api/Manage/Jurisdiction/PageSearchJurisdiction')
  }

  //为角色绑定权限接口
  static async bindRights (
    ID,
    JuIDList
  ) {
    return post('api/Manage/Role/AddJurisdiction', {
      ID,
      JuIDList
    })
  }

  //删除角色接口
  static async deleteRoles(ID)
  {
    return post('api/Manage/Role/Delete',{ID})
  }

  //查询集合接口，为了员工页面绑定角色使用
  static async searchList(){
    return post('api/Manage/Role/PageSearchList')
  }

}

export default RoleManage
